//
//  ViewController.m
//  ZBCategories
//
//  Created by lzb on 2018/8/14.
//  Copyright © 2018年 lzb. All rights reserved.
//

#import "ViewController.h"
#import "UIButton+ZBActionEvent.h"

@interface ViewController ()

@property (nonatomic, strong) UIButton *button;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.button];
    self.button.frame =  CGRectMake(100, 100, 100, 40);
    NSLog(@"%@",self.button);
    [self.button addButtonAction:^(UIButton *button) {
        NSLog(@"点击按钮事件 --%@",button);
    }];
}


- (UIButton *)button
{
    if(_button == nil)
    {
        _button = [UIButton buttonWithType:UIButtonTypeCustom];
        [_button setTitle:@"点击事件" forState:UIControlStateNormal];
        _button.backgroundColor = [UIColor blueColor];
        
    }
    return _button;
}




@end
